package org.aeon.gamechatnest.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;
import org.aeon.gamechatnest.validated.Add;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 私信对话实体
 *
 * @TableName private_letter
 */
@Data
@Schema(description = "私信对话实体", name = "PrivateLetter")
@TableName("private_letter")
public class PrivateLetter implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 私信id
     */
    @Schema(description = "私信id", name = "privateId")
    @Null(groups = {Add.class}, message = "新增时privateId应为空")
    @TableId
    private Long privateId;
    /**
     * 发起用户
     */
    @Schema(description = "发送用户", name = "fromUser")
    @Null(groups = {Add.class}, message = "新增更新时fromUser应为空")
    private Long fromUser;
    /**
     * 接收用户
     */
    @Schema(description = "接收用户", name = "toUser")
    @NotNull(groups = {Add.class}, message = "新增时toUser不能为空")
    private Long toUser;
    /**
     * 创建时间
     */
    @Schema(description = "创建时间", name = "createTime")
    @Null(groups = {Add.class}, message = "新增更新时createTime应为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    /**
     * 发起用户可见性（0：显示，1：隐藏）
     */
    @Schema(description = "发起用户可见性", name = "fromUserShow")
    @Null(groups = {Add.class}, message = "新增时fromUserShow不能为空")
    private Integer fromUserShow;
    /**
     * 接收用户可见性（0：显示，1：隐藏）
     */
    @Schema(description = "接收用户可见性", name = "toUserShow")
    @Null(groups = {Add.class}, message = "新增时toUserShow应为空")
    private Integer toUserShow;
    /**
     * 是否删除（0：存在，1：删除）
     */
    @Schema(description = "是否删除", name = "isDelete",hidden = true)
    @Null(groups = {Add.class}, message = "新增时isDelete应为空")
    private Integer isDelete;
}
